/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "clientes", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Clientes.findAll", query = "SELECT c FROM Clientes c"),
    @NamedQuery(name = "Clientes.findByCliCod", query = "SELECT c FROM Clientes c WHERE c.cliCod = :cliCod"),
    @NamedQuery(name = "Clientes.findByCliApe", query = "SELECT c FROM Clientes c WHERE c.cliApe = :cliApe"),
    @NamedQuery(name = "Clientes.findByCliSex", query = "SELECT c FROM Clientes c WHERE c.cliSex = :cliSex"),
    @NamedQuery(name = "Clientes.findByCliTel", query = "SELECT c FROM Clientes c WHERE c.cliTel = :cliTel"),
    @NamedQuery(name = "Clientes.findByCliDir", query = "SELECT c FROM Clientes c WHERE c.cliDir = :cliDir"),
    @NamedQuery(name = "Clientes.findByCliMail", query = "SELECT c FROM Clientes c WHERE c.cliMail = :cliMail"),
    @NamedQuery(name = "Clientes.findByCliCel", query = "SELECT c FROM Clientes c WHERE c.cliCel = :cliCel"),
    @NamedQuery(name = "Clientes.findByCliNom", query = "SELECT c FROM Clientes c WHERE c.cliNom = :cliNom")})
public class Clientes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cli_cod", nullable = false)
    private Integer cliCod;
    @Size(max = 10)
    @Column(name = "cli_ape", length = 10)
    private String cliApe;
    @Size(max = 20)
    @Column(name = "cli_sex", length = 20)
    private String cliSex;
    @Size(max = 10)
    @Column(name = "cli_tel", length = 10)
    private String cliTel;
    @Size(max = 20)
    @Column(name = "cli_dir", length = 20)
    private String cliDir;
    @Size(max = 20)
    @Column(name = "cli_mail", length = 20)
    private String cliMail;
    @Size(max = 10)
    @Column(name = "cli_cel", length = 10)
    private String cliCel;
    @Size(max = 50)
    @Column(name = "cli_nom", length = 50)
    private String cliNom;
    @ManyToMany(mappedBy = "clientesCollection")
    private Collection<NotasRemi> notasRemiCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clientes")
    private Collection<ReservaTurno> reservaTurnoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cliCod")
    private Collection<Facturas> facturasCollection;

    public Clientes() {
    }

    public Clientes(Integer cliCod) {
        this.cliCod = cliCod;
    }

    public Integer getCliCod() {
        return cliCod;
    }

    public void setCliCod(Integer cliCod) {
        this.cliCod = cliCod;
    }

    public String getCliApe() {
        return cliApe;
    }

    public void setCliApe(String cliApe) {
        this.cliApe = cliApe;
    }

    public String getCliSex() {
        return cliSex;
    }

    public void setCliSex(String cliSex) {
        this.cliSex = cliSex;
    }

    public String getCliTel() {
        return cliTel;
    }

    public void setCliTel(String cliTel) {
        this.cliTel = cliTel;
    }

    public String getCliDir() {
        return cliDir;
    }

    public void setCliDir(String cliDir) {
        this.cliDir = cliDir;
    }

    public String getCliMail() {
        return cliMail;
    }

    public void setCliMail(String cliMail) {
        this.cliMail = cliMail;
    }

    public String getCliCel() {
        return cliCel;
    }

    public void setCliCel(String cliCel) {
        this.cliCel = cliCel;
    }

    public String getCliNom() {
        return cliNom;
    }

    public void setCliNom(String cliNom) {
        this.cliNom = cliNom;
    }

    @XmlTransient
    public Collection<NotasRemi> getNotasRemiCollection() {
        return notasRemiCollection;
    }

    public void setNotasRemiCollection(Collection<NotasRemi> notasRemiCollection) {
        this.notasRemiCollection = notasRemiCollection;
    }

    @XmlTransient
    public Collection<ReservaTurno> getReservaTurnoCollection() {
        return reservaTurnoCollection;
    }

    public void setReservaTurnoCollection(Collection<ReservaTurno> reservaTurnoCollection) {
        this.reservaTurnoCollection = reservaTurnoCollection;
    }

    @XmlTransient
    public Collection<Facturas> getFacturasCollection() {
        return facturasCollection;
    }

    public void setFacturasCollection(Collection<Facturas> facturasCollection) {
        this.facturasCollection = facturasCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cliCod != null ? cliCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Clientes)) {
            return false;
        }
        Clientes other = (Clientes) object;
        if ((this.cliCod == null && other.cliCod != null) || (this.cliCod != null && !this.cliCod.equals(other.cliCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Clientes[ cliCod=" + cliCod + " ]";
    }
    
}
